<%= link_to 'Edit', edit_invoice_path(@invoice) %> |
<%= link_to 'Back', invoices_path %>

<div class="row">
	<div class="col-xs-12 col-md-12">
		<!-- widgets part -->
		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">发票详情</span>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '编辑', edit_invoice_path(@invoice), method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">

					<table class="table table-bordered table-striped table-condensed flip-content">
						<thead class="flip-content bordered-palegreen">

							<tr>
								<th>发票号码</th>
								<th>发票代码</th>
								<th>开票编码</th>
								<th>结算单号</th>
								<th>金额</th>
								<th>税率</th>
								<th>开票日期</th>
								<th>客户</th>
								<th>付款进度</th>
								<th>首款预收金额</th>
								<th>首款预收日期</th>
								<th>余款预收金额</th>
								<th>余款预收日期</th>

							</tr>
						</thead>

						<tbody>
							<tr>
								<td><%= @invoice.invoice_no %></td>
								<td><%= @invoice.invoice_code %></td>
								<td><%= @invoice.invoice_index_code %></td>
								<td><%= @invoice.settlement_slip_no %></td>
								<td><%= @invoice.amount %></td>
								<td><%= @invoice.tax_rate %></td>
								<td><%= @invoice.invoice_date %></td>
								<td><%= @invoice.customer_id %></td>
								<td><%= @invoice.payment_progress %></td>
								<td><%= @invoice.first_installment_amount %></td>
								<td><%= @invoice.first_installment_date %></td>
								<td><%= @invoice.balance_amount %></td>
								<td><%= @invoice.balance_date %></td>

							</tr>

						</tbody>
					</table>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>

		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">开票订单</span>
				
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">

					<table class="table table-bordered table-striped table-condensed flip-content">
						<thead class="flip-content bordered-palegreen">
							<tr>								
								<th>日期</th>
								<th>订单编号</th>
								<th>客户</th>
								<th>客户订单号</th>
								<th>客户订单日期</th>
								<th>金额</th>
								<th>交期</th>
								<th>合同号</th>
								<th>铁塔财务报账号</th>
							</tr>
						</thead>

						<tbody>
							<% @invoice.orders.each do |order| %>
							<tr>								
								<td><%= order.created_at.strftime("%Y-%m-%d") %></td>
								<td><%= order.order_code %></td>
								<td><%= order.customer.name %></td>
								<td><%= order.customer_po %></td>
								<td><%= order.order_date %></td>
								<td><%= order.amount %></td>
								<td><%= order.due_date %></td>
								<td><%= order.contract_no %></td>
								<td><%= order.tieta_settlement_no %></td>
								
							</tr>
							<% end %>
						</tbody>
					</table>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>

		<!-- end of widgets part -->
	</div>
</div>

